1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /** 18 * @addtogroup AHardwareBuffer 19 * @{ 20 */ 21 22 /** 23 * @file hardware_buffer_jni.h 24 * @brief JNI glue for native hardware buffers. 25 */ 26 27 module android.ndk.hardware_buffer_jni; 28 29 import arsd.jni; 30 import android.ndk; 31 32 extern (C): 33 nothrow: 34 @nogc: 35 36 /** 37 * Return the AHardwareBuffer wrapped by a Java HardwareBuffer object. 38 * 39 * This method does not acquire any additional reference to the AHardwareBuffer 40 * that is returned. To keep the AHardwareBuffer live after the Java 41 * HardwareBuffer object got garbage collected, be sure to use AHardwareBuffer_acquire() 42 * to acquire an additional reference. 43 */ 44 AHardwareBuffer* AHardwareBuffer_fromHardwareBuffer ( 45 JNIEnv* env, 46 jobject hardwareBufferObj); 47 48 /** 49 * Return a new Java HardwareBuffer object that wraps the passed native 50 * AHardwareBuffer object. 51 */ 52 jobject AHardwareBuffer_toHardwareBuffer ( 53 JNIEnv* env, 54 AHardwareBuffer* hardwareBuffer); 55 56 // ANDROID_HARDWARE_BUFFER_JNI_H 57 58 /** @} */